<template>
  <prism language="json">
    {{ code }}
  </prism>
</template>

<script>
import Prism from 'vue-prismjs'
import 'prismjs/themes/prism-dark.css'
export default {
  components: {
    Prism
  },
  props: {
    value: {
      type: null,
      required: true
    }
  },
  computed: {
    code() {
      return this.value
    }
  },
  watch: {
    value: {
      handler(e) {
        console.log('code changed:', e)
      },
      deep: true
    }
  }
}
</script>

